package moder

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(100)"`
	Password string `gorm:"type:varchar(100)"`
}

func (u *User) UserAdd(db *gorm.DB) error {
	return db.Create(u).Error
}

func (u *User) UserShow(db *gorm.DB, id int64) error {
	return db.Where("id=?", id).First(u).Error
}

type Home struct {
	Name string `gorm:"type:varchar(100)"`
}
